<pro-header ></pro-header>

<nz-card [nzBordered]="false">
    <!--  form表单搜索 -->
    <form nz-form (ngSubmit)="search()" [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">
            <div nz-col [nzSpan]="8" class="mb-md">
                <div nz-form-item class="d-flex">
                    <div nz-form-label><label for="name">工程名称</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-input [(ngModel)]="productItem.projectName" name="projectName" [nzSize]="'large'" [nzPlaceHolder]="'工程名称'" nzId="projectName"></nz-input>
                    </div>
                </div>
            </div>
            <div  nz-col [nzSpan]="8" class="mb-md">
                <div nz-form-item class="d-flex">
                    <div nz-form-label><label for="status">工程类型</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-select [(ngModel)]="productItem.projectType" name="status" nzId="status" [nzPlaceHolder]="'工程类型'" [nzShowSearch]="true" [nzSize]="'large'">
                            <nz-option *ngFor="let i of projectType; let idx = index" [nzLabel]="i.key" [nzValue]="i.value"></nz-option>
                        </nz-select>
                    </div>
                </div>
            </div>
            <div nz-col [nzSpan]="expandForm ? 24 : 8" class="mb-md" [class.text-right]="expandForm">
                <button nz-button type="submit" [nzType]="'primary'" [nzLoading]="loading" [nzSize]="'large'">查询</button>
                <button nz-button type="reset" (click)="reset()" [nzSize]="'large'" class="mx-sm">重置</button>
            </div>
        </div>
    </form>

    <!-- 监听列表组件，如果点击了则告诉弹出框组件，打开弹出框,监听addCreat方法-->
    <app-list
        [initDate]="data"
        [isPagination]="isPagination"
        [buttons] ='buttons'
        [pageIndex]='pageIndex'
        (addCreat)="addHandler($event)"
        (buttonData)="buttonDataHandler($event)"
        (pageNumber)="monitorHandler($event)"
        (buttonEvent)="buttonEvent($event)"
        (selectedRow)="selectedRow($event)"
        [headerDate]="headerDate"
        [moreData]="moreData"
        [total]="total"
        [showAdd]="showAdd"
        [loading]="listloading" 
        [pageTotal] = 'pageTotal'></app-list>
</nz-card>

<!--新增工程内容-->
<nz-modal [nzVisible]="modalVisible" [nzWidth]="1024" [nzTitle]="modelTitle" [nzConfirmLoading]="loading" [nzContent]="modalContent"
          (nzOnCancel)="cancel()" (nzOnOk)="save()">
    <ng-template #modalContent>
        <div nz-row [nzGutter]="24">
            <div nz-col [nzSpan]="24" class="mb-md">
                <div nz-form-item class="d-flex">
                    <div nz-form-label class="alignment"><label for="no"> 工程名称</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-input [(ngModel)]="productAdd.projectName" name="projectName" [nzSize]="'large'" [nzPlaceHolder]="'工程名称'" nzId="projectName"></nz-input>
                    </div>
                </div>
            </div>
           
             <div nz-col [nzSpan]="24" class="mb-md">
                    <div nz-form-item class="d-flex">
                      <div nz-form-label class="alignment"><label for="no">分支路径</label></div>
                        <div nz-form-control class="flex-1">
                              <!--<textarea rows="6"  nz-input [(ngModel)]="branch.branchFor"  nzRequired  nzId="branchFor" [ngModelOptions]="{standalone: true}" ></textarea>-->
                            <nz-input [(ngModel)]="productAdd.fullPath" name="fullPath" (ngModelChange)="checkagin(productAdd.fullPath)"  type='url' aria-required="true" [nzSize]="'large'" [nzPlaceHolder]="'分支全路径'" nzId="fullPath"></nz-input>
                         <nz-alert *ngIf='isShowbranch == false' nzBanner nzMessage="验证异常"></nz-alert>
                        </div>
                          <div nz-form-label nz-col [nzSpan]="2" ><button type="button"  (click)="checkversion(productAdd.fullPath)" nz-button [nzType]="'default'">
                        <span>{{tag}}</span>
                        </button>
    </div>
                    </div>

                </div>
                 <div nz-col [nzSpan]="24" class="mb-md">
                <div nz-form-item class="d-flex">
                    <div nz-form-label class="alignment"><label for="no">工程类型</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-select style="width:100%" [(ngModel)]="productAdd.projectType"  nzAllowClear     (ngModelChange)="changePro(productAdd.projectType)"  name="projectType"  [nzSize]="'large'" [nzPlaceHolder]="'工程类型'" nzId="projectType">
                            <nz-option  *ngFor="let i of projectType; let idx = index" [nzLabel]="i.key" [nzValue]="i.value"></nz-option>
                        </nz-select>
                    </div>
                </div>
            </div>
<div nz-col [nzSpan]="20" [nzOffset]="2" class="divContent" *ngFor="let i of exportTypeList">
    <div nz-col [nzSpan]="1" class="mb-md"><label nz-checkbox [nzDisabled]="i.disabled"  [ngModel]="i.checked" (ngModelChange)="checkbox($event,i)">
    </label></div>
<div nz-col [nzSpan]="11" >
                <div nz-form-item class="d-flex">
                    <div nz-form-label class="alignment"><label for="no"> 导出为</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-input nzReadonly='true' [(ngModel)]="i.name" name="exportType" [nzSize]="'large'"  [nzPlaceHolder]="'部署到'"></nz-input>
                    </div>
                </div>
            </div>
            <div nz-col [nzSpan]="12" >
              
                 <div nz-col [nzSpan]="24"  *ngFor="let s of i.children; let idx = index" >
                     <div nz-col [nzSpan]="3" ><label nz-checkbox    [nzDisabled]="s.disabled" [ngModel]="s.checked"  (ngModelChange)="checkboxChild($event,s,i)" >
                  </label></div>
                <div nz-form-item class="d-flex" >
                    <div nz-form-label class="alignment"><label for="no">部署到</label></div>
                    <div nz-form-control class="flex-1">
                        <nz-input nzReadonly='true' [(ngModel)]="s.name" name="where" [nzSize]="'large'"  [nzPlaceHolder]="'部署到'"></nz-input>
                    </div>
                </div>
                </div>
            </div>
  </div>

            <!--<div nz-col [nzSpan]="24" class="mb-md">
                <div *ngFor="let i of diconfig; let index = index">
                    <div nz-row [nzGutter]="24" style="margin:10px 0px; ">
                        <div nz-col [nzSpan]="2" class="mb-md">
                            <i  class="anticon anticon-plus" style="font-size: 30px; width: 20%; margin-right:35%"  (click)="addInput()"></i>
                            <i   *ngIf="diconfig.length  > 1" class="anticon anticon-minus" style="font-size: 30px; width: 20%;"  (click)="removeInput(i)"></i>
                        </div>
                        <div nz-col [nzSpan]="10" class="mb-md">
                            <div nz-form-item class="d-flex">
                                <div nz-form-label class="alignment"><label for="no"> 导出为</label></div>
                                <div nz-form-control class="flex-1">
                                    <nz-input  [(ngModel)]="i.exportType"  (nzBlur)="onblur(i,index,diconfig)" [name]="i.exportType" [nzSize]="'large'" [nzPlaceHolder]="'导出类型'"></nz-input>
                                    <div *ngIf="i.error" style="color:red" nz-form-explain>不能存在重复的导出类型</div>
                                </div>
                            </div>
                        </div>-->
                        <!--只有一个的时候不偏移， 多个的话就偏移到对应的位置  [nzOffset]="(i.depolySelect.length > 2 ) ? 0:10"-->
                        <!--<div nz-col [nzSpan]="8"   class="mb-md" >
                            <div  nz-col [nzSpan]="24"  *ngFor="let s of i.depolySelect">
                                <div nz-form-item class="d-flex">
                                    <div nz-form-label class="alignment"><label for="no"> 部署到</label></div>
                                    <div nz-form-control class="flex-1">
                                        <nz-input [(ngModel)]="s.depoly" [name]="s"   [nzPlaceHolder]="'部署类型'"></nz-input>
                                    </div>
                                    <i class=" anticon anticon-plus-circle-o" style="font-size: 27px; margin: 0  5px"  (click)="addChildInput(i.depolySelect)"></i>
                                    <i  *ngIf="i.depolySelect.length > 1"  class="anticon anticon-minus-circle-o dynamic-delete-button" style="font-size: 27px;"  (click)="removeChildInput(i.depolySelect,i)"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->

        </div>
    </ng-template>
</nz-modal>

